package com.fs.common.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fs.common.annotation.ColumnDesc;
import lombok.*;

import java.util.Date;


/**
 * 菜谱模板
 * @author liji-PC
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("yz_recipes_template")
@EqualsAndHashCode(callSuper=false)
public class RecipesTemplate extends Model<RecipesTemplate> {

    @TableField(exist = false)
    private Recipes recipes;

    @ColumnDesc(name = "主键")
    @TableId(type = IdType.UUID, value = "id")
    public String templateId;

    @TableField(value = "create_time")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date createTime = new Date();

    @TableField(value = "template_code")
    private String code;

    @TableField(value = "recipes_id")
    private String recipesId;

    /**
     * 名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 食材
     */
    @TableField(value = "foods")
    private String foods;

    /**
     * 步骤
     */
    @TableField(value = "step")
    private String step;

    /**
     * 功效
     */
    @TableField(value = "effect")
    private String effect;

    /**
     * 主食材
     */
    @TableField(value = "main_food")
    private String mainFood;

    /**
     * 适宜体质
     */
    @TableField(value = "suitable")
    private String suitable;

    /**
     * 不宜症状
     */
    @TableField(value = "not_suitable")
    private String notSuitable;

    /**
     * 适宜症状
     */
    @TableField(value = "suitable_symptom")
    private String suitableSymptom;

    /**
     * 周
     */
    @TableField(value = "week")
    private String week;

    /**
     * 天
     */
    @TableField(value = "day")
    private String day;

    /**
     * 餐
     */
    @TableField(value = "meal")
    private String meal;

    /**
     * 菜类型
     */
    @TableField(value = "food_type")
    private String foodType;

    /**
     * 生产方式
     */
    @TableField(value = "mode_type")
    private String modeType;

    /**
     * 忌口
     */
    @TableField(value = "avoid_food")
    private String avoidFood;

    /**
     * 喂养方式
     */
    @TableField(value = "feed_type")
    private String feedType;

    @TableField(value = "type")
    private String type;

    public void analysisRecipes(){
        this.setRecipesId(recipes.getId());
        this.setName(recipes.getName());
        this.setFoods(recipes.getFoods());
        this.setMainFood(recipes.getMainFood());
        this.setStep(recipes.getStep());
        this.setEffect(recipes.getEffect());
        this.setSuitable(recipes.getSuitable());
        this.setSuitableSymptom(recipes.getSuitableSymptom());
        this.setNotSuitable(recipes.getNotSuitable());
        this.setWeek(recipes.getWeek());
        this.setDay(recipes.getDay());
        this.setMeal(recipes.getMeal());
        this.setFoodType(recipes.getFoodType());
        this.setModeType(recipes.getModeType());
        this.setFeedType(recipes.getFeedType());
        this.setAvoidFood(recipes.getAvoidFood());
        this.setType(recipes.getType());
    }
}
